#ifndef TOOLBRACHCT_H
#define TOOLBRACHCT_H
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QtWidgets>
#include "solar/trunk/NinsipidView.h"
#include "solar/trunk/NWidget.h"
#include "solar/trunk/NEdit.h"
#include "solar/trunk/NScrollLabel.h"
#include "solar/trunk/NMatchKeyWord.h"
#include "solar/trunk/NListWidget.h"

class ToolBranchCT {

public:
    ToolBranchCT();

    QWidget *CloakCentra = new QWidget();

    //PublicStackWidget
    QStackedWidget *PBL_centraStackWidget = new QStackedWidget(CloakCentra);

    //AnlyTools Section Gui
    NListWidget *BS_listWidget = new NListWidget(CloakCentra);
    NinsipidView *DT_scdtEditAsClear = new NinsipidView(CloakCentra);
    NinsipidView *DT_rsdtEditAsClear = new NinsipidView(CloakCentra);
    NPlainEdit *DT_scdtEdit = new NPlainEdit(CloakCentra);
    NPlainEdit *DT_rsdtEdit = new NPlainEdit(CloakCentra);
    NinsipidView *DT_scview = new NinsipidView("数据", CloakCentra);
    NinsipidView *DT_rsview = new NinsipidView("结果", CloakCentra);
    NinsipidView *DT_hlview = new NinsipidView("高亮", CloakCentra);
    NinsipidView *DT_remove = new NinsipidView("删除", CloakCentra);
    QHBoxLayout DT_multiFacehBox;

    QWidget *CP_Widget = new QWidget(CloakCentra);
    QString CP_Format = "[源文件]:\n"
                        "FileName[char*]\n\n"
                        "[目标文件]:\n"
                        "FileName[char*]\n\n"
                        "[源文件工作簿索引]:\n"
                        "Index[uint] *为空则默认当前工作簿\n\n"
                        "[目标工作簿索引]:\n"
                        "Index[uint] *为空则默认当前工作簿\n\n"
                        "[源文件对比列]:\n"
                        "Index[uint]\n\n"
                        "[目标对比列]:\n"
                        "Index[uint]\n\n";
    NSyntaxHignLight *CP_detialHighLigh = new NSyntaxHignLight();
    QPlainTextEdit *CP_detialEdit = new QPlainTextEdit(CloakCentra);
    QListWidget *CP_compareListWidget = new QListWidget(CloakCentra);
    QPushButton *CP_indexSubmit = new QPushButton("索引提交", CloakCentra);
    QVBoxLayout *CP_indexSubvBox = new QVBoxLayout();
    QHBoxLayout *CP_globalhBox = new QHBoxLayout();

    QWidget *QR_Widget = new QWidget(CloakCentra);
    QVBoxLayout *QR_globalvBox = new QVBoxLayout();
    QHBoxLayout *QR_toolhBox = new QHBoxLayout();

    Nwidget *QR_topWidget = new Nwidget(CloakCentra);
    QCheckBox *QR_modeCutBox = new QCheckBox("摄像机格式", CloakCentra);
    QCheckBox *QR_saveQrBox = new QCheckBox("保存至本地", CloakCentra);
    NScrollLabel *QR_hintLabel = new NScrollLabel(1, CloakCentra);
    QPushButton *QR_saveBut = new QPushButton("保存/更改", CloakCentra);
    QVBoxLayout *QR_topvBox = new QVBoxLayout();
    QHBoxLayout *QR_tophBox = new QHBoxLayout();

    QScrollArea *QR_areaWidget = new QScrollArea(CloakCentra);
    QLabel *QR_qrcodeLabel = new QLabel("二维码将在此展示", CloakCentra);

    QPlainTextEdit *QR_dataEdit = new QPlainTextEdit(CloakCentra);
    QPlainTextEdit *QR_keysEdit = new QPlainTextEdit(CloakCentra);
    QPlainTextEdit *QR_aliasEdit = new QPlainTextEdit(CloakCentra);

    QSerialPort *SP_sralPort = new QSerialPort();
    QWidget *SP_Widget = new QWidget(CloakCentra);
    QGridLayout *SP_globalGrid = new QGridLayout(SP_Widget);

    QTabWidget *SP_TabWidget = new QTabWidget(CloakCentra);
    NinsipidView *SP_serialEditAsClear = new NinsipidView();
    NinsipidView *SP_serialEditAsUpdater = new NinsipidView();
    NinsipidView *SP_serialEditAsDownLoad = new NinsipidView();
    NPlainEdit *SP_serialInfoEdit = new NPlainEdit(CloakCentra);
    NSyntaxHignLight *SyntaxHLight = new NSyntaxHignLight();
    QTextDocument *SP_docuMent = SP_serialInfoEdit->document();
    QAbstractTextDocumentLayout *documentLayout = SP_docuMent->documentLayout();
    NMatchKeyWord *MatchKeyWord = new NMatchKeyWord(SP_docuMent);

    QMap<QSerialPort::SerialPortError, QString> SerialErrorMap;

    Nwidget *SP_configWidget = new Nwidget(CloakCentra);
    NinsipidView *SP_portLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_baudLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_dtbitsLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_stbitsLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_ckPlaceLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_scontrolLabel = new NinsipidView(CloakCentra);
    QToolButton *SP_usbportBut = new QToolButton(CloakCentra);
    QToolButton *SP_dtplaceBut = new QToolButton(CloakCentra);
    QToolButton *SP_baudrateBut = new QToolButton(CloakCentra);
    QToolButton *SP_stplaceBut = new QToolButton(CloakCentra);
    QToolButton *SP_ckplaceBut = new QToolButton(CloakCentra);
    QToolButton *SP_scontrolBut = new QToolButton(CloakCentra);
    QPushButton *SP_connectSqlSaveBut = new QPushButton("保存", CloakCentra);
    QPushButton *SP_connectSqlAlterBut = new QPushButton("更改", CloakCentra);

    QMenu *SP_usbPortMenu = new QMenu(CloakCentra);
    QMenu *SP_baudRateMenu = new QMenu(CloakCentra);
    QMenu *SP_dtplaceMenu = new QMenu(CloakCentra);
    QMenu *SP_stplaceMenu = new QMenu(CloakCentra);
    QMenu *SP_ckplaceMenu = new QMenu(CloakCentra);
    QMenu *SP_scontrolMenu = new QMenu(CloakCentra);

    QAction *AS_baudr115200 = new QAction("115200");
    QAction *AS_baudr57600 = new QAction("57600");
    QAction *AS_baudr38400 = new QAction("38400");
    QAction *AS_baudr19200 = new QAction("19200");
    QAction *AS_baudr9600 = new QAction("9600");
    QAction *AS_baudr4800 = new QAction("4800");
    QAction *AS_baudr2400 = new QAction("2400");
    QAction *AS_baudr1200 = new QAction("1200");

    QAction *AS_oddParity = new QAction("奇校验");
    QAction *AS_evenParity = new QAction("偶校验");
    QAction *AS_unParity = new QAction("无校验");

    QAction *AS_dtbitsFive = new QAction("bits 5");
    QAction *AS_dtbitsSix = new QAction("bits 6");
    QAction *AS_dtbitsSeven = new QAction("bits 7");
    QAction *AS_dtbitsEight = new QAction("bits 8");

    QAction *AS_stbitsOne = new QAction("bits 1");
    QAction *AS_stbitshalf = new QAction("bits 1.5");
    QAction *AS_stbitsTwo = new QAction("bits 2");

    QAction *AS_hardControl = new QAction("硬件控制");
    QAction *AS_softControl = new QAction("软件控制");
    QAction *AS_unControl = new QAction("无控制");

    QVBoxLayout *portvBox = new QVBoxLayout();
    QVBoxLayout *baudvBox = new QVBoxLayout();
    QVBoxLayout *dtbitsvBox = new QVBoxLayout();
    QVBoxLayout *stbitsvBox = new QVBoxLayout();
    QVBoxLayout *ckplacevBox = new QVBoxLayout();
    QVBoxLayout *scontrolvBox = new QVBoxLayout();
    QHBoxLayout *connecthBox = new QHBoxLayout();
    QVBoxLayout *connectvBox = new QVBoxLayout();
    QHBoxLayout *confighBox = new QHBoxLayout();

    Nwidget *SP_commandWidget = new Nwidget(CloakCentra);
    QHBoxLayout *SP_commandhBox = new QHBoxLayout(SP_commandWidget);
    QVBoxLayout *SP_commandLvBox = new QVBoxLayout();
    QVBoxLayout *SP_commandRvBox = new QVBoxLayout();
    QPushButton *SP_commandsendBut = new QPushButton("发送", CloakCentra);
    QPushButton *SP_commandinputBut = new QPushButton("剪贴板导入", CloakCentra);
    QPushButton *SP_commandsaveBut = new QPushButton("保存", CloakCentra);
    QCheckBox *SP_newlineCheckBox = new QCheckBox("回车换行", CloakCentra);
    NPlainEdit *SP_commandEdit = new NPlainEdit(CloakCentra);

    QString SP_taskTimer_Reboot = "\\s*task\\s+(\\d+)";
    QString SP_taskTimer_RebootE = "\\s*task\\s+stop";
    QMap<QString, QList<QString>> SP_taskMap;

    Nwidget *SP_hlightWidget = new Nwidget(CloakCentra);
    QHBoxLayout *SP_hlHbox = new QHBoxLayout(SP_hlightWidget);
    QHBoxLayout *SP_hltextHbox = new QHBoxLayout();
    QVBoxLayout *SP_hltextVbox = new QVBoxLayout();
    QVBoxLayout *SP_hlbkclVbox = new QVBoxLayout();
    QVBoxLayout *SP_hlfrclVbox = new QVBoxLayout();
    NinsipidView *SP_hltextLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_hlbkclLabel = new NinsipidView(CloakCentra);
    NinsipidView *SP_hlfrclLabel = new NinsipidView(CloakCentra);
    QLineEdit *SP_hltextEdit = new QLineEdit(CloakCentra);
    QLineEdit *SP_hlbkclEdit = new QLineEdit(CloakCentra);
    QLineEdit *SP_hlfrclEdit = new QLineEdit(CloakCentra);
    QPushButton *SP_hlsubmitBut = new QPushButton("保存", CloakCentra);

    Nwidget *SP_ksearchWidget = new Nwidget(CloakCentra);
    QHBoxLayout *SP_ksearchHbox = new QHBoxLayout(SP_ksearchWidget);
    QVBoxLayout *SP_kcheckVbox = new QVBoxLayout();
    QLineEdit *SP_ksearchEdit = new QLineEdit(CloakCentra);
    QCheckBox *SP_findBackward = new QCheckBox("向后查找", CloakCentra);
    QCheckBox *SP_sensiticeCheck = new QCheckBox("区分大小写", CloakCentra);
    QPushButton *SP_ksubmitBut = new QPushButton("查找", CloakCentra);

    Nwidget *SPitem_viewWidget = new Nwidget(true, 5000, CloakCentra);
    NinsipidView *SPitem_viewNikeLB = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewBaudLB = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewDtplLB = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewStplLB = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewCheckLB = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewStreamLB = new NinsipidView(CloakCentra);

    NinsipidView *SPitem_viewBaudV = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewdataplV = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewStopplV = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewNikeV = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewCheckV = new NinsipidView(CloakCentra);
    NinsipidView *SPitem_viewStreamV = new NinsipidView(CloakCentra);

    QHBoxLayout *SPitem_porthBox = new QHBoxLayout();
    QHBoxLayout *SPitem_baudhBox = new QHBoxLayout();
    QHBoxLayout *SPitem_dtbitshBox = new QHBoxLayout();
    QHBoxLayout *SPitem_stbitshBox = new QHBoxLayout();
    QHBoxLayout *SPitem_ckplacehBox = new QHBoxLayout();
    QHBoxLayout *SPitem_scontrolhBox = new QHBoxLayout();
    QVBoxLayout *SPitem_connectvBox = new QVBoxLayout();

private:
    MOUSE_ATTRIBUTE MSEVKEY;
    Extend definfc;

};
#endif

